<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学IT - 后台管理系统</title>
    <?php include( './views/common/style.html' ) ?>
</head>
<body>
    
    <!-- 侧边栏 -->
    <?php include( './views/common/aside.html' ) ?>
    <!-- 主体 -->
    <div class="main">
        <div class="container-fluid">
            <!-- 头部 -->
            <?php include( './views/common/header.html' ) ?>
            <div class="body course-add">
                <!-- 面包屑 -->
                <ol class="breadcrumb">
                    <li><a href="javascript:;">课程管理</a></li>
                    <li class="active">课程添加</li>
                </ol>
                <div class="steps">
                    <!-- 摘要, 步骤, 信息 -->
                </div>
            </div>
        </div>
    </div>

    <script type="txt/template" id="step1Tpl">
        <!-- 摘要 -->
        <div class="brief">
            <div class="thumb">
                {{ if cs_cover }}
                    <img src="{{ cs_cover }}" alt="">
                {{ /if }}
            </div>
            <dl class="info">
                <dt>{{ cs_name }}</dt>
                <dd>讲师：{{ tc_name || '未分配' }}</dd>
                <dd>课时：0</dd>
            </dl>
        </div>
        <!-- 步聚 -->
        <ul class="forwards list-unstyled">
            <li>
                <a href="/course/add_step1?cs_id={{ cs_id }}" class="active">
                <b>1</b>
                基本信息
                </a>
            </li>
            <li>
                <a href="/course/add_step2?cs_id={{ cs_id }}">
                <b>2</b>
                课程图片
                </a>
            </li>
            <li>
                <a href="/course/add_step3?cs_id={{ cs_id }}">
                <b>3</b>
                课时管理
                </a>
            </li>
        </ul>
        <!-- 基本信息 -->
        <div class="content">
            <!-- 标题 -->
            <div class="title">
                <h5>基本信息 <small>BASIC INFORMATION</small></h5>
            </div>
            <form id="add_step1_form" class="basic form-horizontal">
                <input type="hidden" name="cs_id" value="{{ cs_id }}" />
                <div class="form-group">
                    <label for="" class="col-md-2 control-label">标题</label>
                    <div class="col-md-8">
                        <input type="text" 
                               name="cs_name"
                               class="form-control input-sm" 
                               value="{{ cs_name }}">
                    </div>
                </div>
                <div class="form-group">
                    <label for="" class="col-md-2 control-label">课程描述</label>
                    <div class="col-md-8 ckeditor">
                        <textarea name="cs_brief" 
                                  id="cs_brief" 
                                  rows="15" 
                                  class="form-control input-sm">{{ cs_brief }}</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label for="" class="col-md-2 control-label">讲师</label>
                    <div class="col-md-8">
                        <select name="cs_tc_id" class="form-control input-sm">
                            <option>请选择讲师</option>
                            {{ each teacher }}
                                <option 
                                    value="{{ $value.tc_id }}"
                                    {{ if cs_tc_id == $value.tc_id }}selected{{ /if }}
                                    >{{ $value.tc_name }}</option>
                            {{ /each }}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label for="" class="col-md-2 control-label">分类</label>
                    <div class="col-md-8">
                        <select id="cs_cg_pid" class="form-control input-sm">
                            <option>请选择分类</option>
                            {{ each category.top }}
                                <option 
                                    value="{{ $value.cg_id }}"
                                    {{ if cs_cg_pid == $value.cg_id }}selected{{ /if }}
                                    >{{ $value.cg_name }}</option>
                            {{ /each }}
                        </select>
                        <select name="cs_cg_id" id="cs_cg_id" class="form-control input-sm">
                            <option>请选择</option>
                            {{ each category.childs }}
                                <option 
                                    value="{{ $value.cg_id }}"
                                    {{ if cs_cg_id == $value.cg_id }}selected{{ /if }}
                                    >{{ $value.cg_name }}</option>
                            {{ /each }}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label for="" class="col-md-2 control-label">标签</label>
                    <div class="col-md-8">
                        <input type="text" 
                               name="cs_tags"
                               class="form-control input-sm" 
                               value="{{ cs_tags }}">
                        <p class="help-block">将会应用于按标签搜索课程、相关课程的提取等</p>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-10">
                        <input type="submit"
                               class="btn btn-success btn-sm pull-right"
                               value="保 存"/>
                    </div>                          
                </div>
            </form>
        </div>

    </script>

    <?php include( './views/common/script.html' ) ?>
    <script>
        
        require( [ 'step1' ] );

    </script>
</body>
</html>